<?php

class order_shipping extends a_dynamic_prop {

    public function get_property_name(){
        return $this->_prefix()."order_shipping_charge_obj";
    }

    public function run( i_base_model $caller){
        $std = new stdClass();
        if($caller->id!==NULL){
            $shipping_manager = new shipping_manager();
            $info =  $shipping_manager->get_shipping_info($caller->id);
            if($info!==NULL){
                $driver_obj = $info->get_carrier_obj();
                $std = $info->convert_to_simple_data();                
                $std->description = $driver_obj->get_description();                
                unset($info);
                unset ($driver_obj);
            }
            
            unset ($shipping_manager);
        }
        return $std;
    }

    public function for_model(){
        return "order_m_order";
    }

    public function run_once(){
        return FALSE;
    }
}
?>